/*
 * File:   GroceryFileSystem.h
 * Author: Macaire
 *
 * Created on November 30, 2012, 9:46 AM
 */

#ifndef GROCERYFILESYSTEM_H
#define	GROCERYFILESYSTEM_H
#include "FoodGroup.h"
#include "sstream"

class GroceryFileSystem {
public:
    string Write();
    GroceryFileSystem(FoodGroup FG);
    void AppendRecordLength();
private:    
    string record;
};

GroceryFileSystem::GroceryFileSystem(FoodGroup FG){
    ostringstream A, B, C, D, E, F, G, H;
    //Food Item append
    record.append(FG.getName());
    A<<FG.getPrice();
    record.append(A.str());
    B<<FG.getCount();
    record.append(B.str());
    C<<FG.getWeight();
    record.append(C.str());
    //Date append
    D << FG.getDay();
    record.append(D.str());
    E << FG.getMonth();
    record.append(E.str());
    F << FG.getYear();
    record.append(F.str());
    //Location append
    G << FG.getAddress();
    record.append(G.str());
    record.append(FG.getStreetName());
    record.append(FG.getCity());
    record.append(FG.getState());
    H << FG.getZipCode();
    record.append(H.str());
    cout<<Write()<<endl;
}

string GroceryFileSystem::Write(){
    return record;
}

#endif	/* GROCERYFILESYSTEM_H */

